/*!
 * \file KeyEvent.h
 * \brief Contains the definition of KeyEvent
 * \author CHOUVENC Guillaume, DE CHOULOT Fabien, MATHIEU Fabien
 */
#ifndef KEYEVENT_H
#define KEYEVENT_H

#include "bga/system/Event.h"
#include "bga/window/Window.h"

/**
 * \namespace bga
 * \brief API namespace
 */
namespace bga
{

namespace Key
{
    enum Code
    {
        K_NONE = -1,
        K_A = 0,
        K_B,
        K_C,
        K_D,
        K_E,
        K_F,
        K_G,
        K_H,
        K_I,
        K_J,
        K_K,
        K_L,
        K_M,
        K_N,
        K_O,
        K_P,
        K_Q,
        K_R,
        K_S,
        K_T,
        K_U,
        K_V,
        K_W,
        K_X,
        K_Y,
        K_Z,
        K_0,
        K_1,
        K_2,
        K_3,
        K_4,
        K_5,
        K_6,
        K_7,
        K_8,
        K_9,
        K_UP,
        K_DOWN,
        K_RIGHT,
        K_LEFT,
        K_ESCAPE
    };
}

/*!
 * \brief Represents a Key Event
 *
 * This class represents a Key Event. It would detect if the key have been pressed or released.
 * This event would be get by a KeyListener
 */
class BOARD_HELL_ENGINE KeyEvent : public Event< bga::Window >
{
    public:

        /*!
         * \brief Contructor
         *
         * Default Contructor
         */
        KeyEvent();

        /*!
         * \brief Contructor
         * \param sender : Window which have sent the event
         *
         * Contructor with the sender
         */
        KeyEvent(const bga::Window &sender);

        /*!
         * \brief Destructor
         */
        virtual ~KeyEvent();

        /*!
         * \brief Getter of the key used
         * \return the code of the key used
         *
         * Return the code of the key used
         */
        Key::Code getKeyCode() const;

        /*!
         * \brief Setter of the key used
         * \param code : key used
         *
         * Set the code of the key used
         */
        void setKeyCode(Key::Code code);

    private:
        Key::Code code; ///<! Contains the Key used

};
}

#endif // KEYEVENT_H

